<template>
    <div class="my-bind">
        <input-title :title="title" :required="required"></input-title>
        <div class="bind">
            <p class="content" :data-font="$i18n.locale" :data-content="!!history">{{ history ||
            placeholder }}
            </p>
            <div class="btn">
                <div class="value mouse-active" :data-font="$i18n.locale" @click="btn">{{
                    history?
                valueActive: value
                }}</div>
            </div>
        </div>
    </div>
</template>

<script>
import inputTitle from '../input-title'
export default {
    name: 'myBind',
    components: {
        inputTitle
    },
    props: {
        title: {
            type: String,
            default: ''
        },
        placeholder: {
            type: [String, Number],
            default: '无'
        },
        required: {
            type: Boolean,
            default: false
        },
        history: {
            type: [String, Number],
            default: ''
        },
        value: {
            type: [String, Number],
            default: ''
        },
        valueActive: {
            type: [String, Number],
            default: ''
        },
        name: {
            type: String,
            default: ''
        }


    },

    methods: {
        btn() {
            if (!this.history) {
                this.$emit('btn')
            } else {
                this.$emit('btnActive')
            }
        }
    }

}
</script>

<style lang="less" scoped>
.my-bind {
    display: flex;
    flex-shrink: 1;
    flex-direction: column;

    .content {
        color: #C5C5CA;
    }

    .content[data-content=true] {
        color: #68656C;
    }

    .content[data-font='zh'] {
        font-size: 0.53rem;
        line-height: 0.85rem;
        font-family: 'IdeaFonts-DianHei-DEJ', 'IdeaFonts-DianHei';
        font-weight: normal;
    }

    .content[data-font='en'] {
        font-size: 0.48rem;
        font-family: 'Helvetica';
        line-height: 0.75rem;
    }

    .value {
        font-size: 0.53rem;
        font-weight: normal;
        color: #7709CC;
        line-height: 0.85rem;
    }

    .value[data-font='zh'] {
        font-family: 'IdeaFonts-DianHei-EEJ', 'IdeaFonts-DianHei';
    }

    .value[data-font='en'] {
        font-family: 'Helvetica';
    }

    .bind {
        display: flex;
        align-items: center;
    }

    .btn {
        margin-left: 0.64rem;
    }
}
</style>